package com.ssy.lingxi.report.model.constant.pay;

/**
 * 授信申请外部状态
 * @author 伍将
 * @date 2020/8/17 20:41
 * @version 2.0.0
 */
public enum CreditApplyInnerStatusEnum {

    ALL(0, "所有", 0, ""),

    /**
     * 待提交 - 1
     */
    WAIT_SUBMIT(1, "待提交", 1, "提交授信申请单"),

    /**
     * 提交审核 - 2
     */
    SUBMIT_VERIFY(2, "提交审核", 2, "提交审核授信申请单"),

    /**
     * 一级审核通过 - 3
     */
    WAIT_VERIFY_STEP1(3, "待审核", 3, "审核授信申请单"),

    /**
     * 二级审核通过 - 4
     */
    WAIT_VERIFY_STEP2(4, "待审核", 4, "审核授信申请单"),

    /**
     * 三级审核通过 - 5
     */
    WAIT_VERIFY_STEP3(5, "审核通过", 5, "审核授信申请单"),

    /**
     * 审核不通过 - 6
     */
    VERIFY_NOT_PASSED(6, "审核不通过", 5, "审核授信申请单"),

    /**
     * 确认审核通过 - 7
     */
    CONFIRM_VERIFY_PASSED(7, "审核通过", 0, "确认审核授信申请单"),

    /**
     * 确认审核不通过 - 8
     */
    CONFIRM_VERIFY_NOT_PASSED(8, "审核不通过", 0, "确认审核授信申请单");

    private final Integer code;
    private final String message;
    private final String remark;
    /**
     * 工作流对应步骤
     */
    private final Integer nextStep;

    CreditApplyInnerStatusEnum(Integer code, String message, Integer nextStep, String remark) {
        this.code = code;
        this.message = message;
        this.nextStep = nextStep;
        this.remark = remark;
    }

    public Integer getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }

    public String getRemark() {
        return remark;
    }

    public Integer getNextStep() {
        return nextStep;
    }

    public static String getItemRemark(Integer code) {
        for (CreditApplyInnerStatusEnum e : CreditApplyInnerStatusEnum.values()) {
            if (e.getCode().equals(code)) {
                return e.getRemark();
            }
        }
        return ALL.getRemark();
    }

    public static Integer getItemNextStep(Integer code) {
        for (CreditApplyInnerStatusEnum e : CreditApplyInnerStatusEnum.values()) {
            if (e.getCode().equals(code)) {
                return e.getNextStep();
            }
        }
        return ALL.getNextStep();
    }

    public static String getItemMessage(Integer code) {
        for (CreditApplyInnerStatusEnum e : CreditApplyInnerStatusEnum.values()) {
            if (e.getCode().equals(code)) {
                return e.getMessage();
            }
        }
        return ALL.getMessage();
    }
}
